﻿@model IEnumerable<ModalDownload.Models.ClassTable>
@using ModalDownload.Models;
@{
    ViewBag.Title = "主页";
    List<ModelTable> recommend=ModelTable.GetRecommend(1,20,"3d");
    List<ModelTable> hot = ModelTable.GetHot(0, 24,"3d");
    List<ModelTable> Picrecommend = ModelTable.GetRecommend(0, 5, "pic");
}
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tbody><tr>
    <td align="center" valign="middle" style="padding-top:5px;padding-bottom:5px;">
        @*首页顶部条形广告1*@
        @ADTable.GetADCode("2")
    </td>
    </tr>
  <tr>
    <td align="center" valign="middle" style="padding-top:5px;padding-bottom:5px;">
        @*首页顶部条形广告2*@
        @ADTable.GetADCode("3")
    </td>
    </tr>
</tbody></table>

<table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
  <tbody><tr>
    <td align="left" valign="top" class="zuo"><div class="dhs"></div>
<div class="dhz">
    @foreach (ClassTable classtable in Model)
    {
        <div class="lm"><ul><b>@Html.ActionLink(@classtable.classname, "List", "Home", new { type="3d",cat=classtable.ID},null)</b>
            @foreach (ClassTable ct in ClassTable.GetAllClassByParent(@classtable.ID))
            {
                <li>@Html.ActionLink(@ct.classname, "List", "Home", new { type="3d",cat=ct.ID},null)</li>
            }
        </ul><img src="/Images/dhlm3.jpg"></div>
    }
</div>
<div class="dhx"></div></td>
    <td align="center" valign="top" class="zhong">

<table width="820" border="0" cellspacing="0" cellpadding="0">

      <tbody><tr>
        <td>


<table width="820" height="240" border="0" cellpadding="0" cellspacing="0">
          <tbody><tr>
            <td width="410" align="right" valign="middle">

<table width="380" height="260" border="3" align="center" cellpadding="0" cellspacing="0" bordercolor="#090909">
                <tbody><tr>
                  <td align="center" valign="middle">
                    @*首页顶部广告1*@
                    @ADTable.GetADCode("4")
</td>
                </tr>
              </tbody></table>
  
  </td>
            <td align="left" valign="middle">

<table width="380" height="260" border="3" align="center" cellpadding="0" cellspacing="0" bordercolor="#090909">
                <tbody><tr>
                  <td align="center" valign="middle">
                    @*首页顶部广告2*@
                    @ADTable.GetADCode("5")
</td>
                </tr>
              </tbody></table>

</td>
          </tr>
        </tbody></table>	

  
</td>
      </tr>
  
   <tr>
        <td height="40" align="left" valign="middle">&nbsp;&nbsp;&nbsp;
          <div style="font-size: 18px;font-weight: bold;color: #FF3000;">&nbsp;&nbsp;&nbsp;最新推荐</div></td>
      </tr>
  
<tr><td>
<table width="820" height="240" border="0" cellpadding="0" cellspacing="0">
          <tbody><tr>
              @foreach (ModelTable model in ModelTable.GetRecommend(0, 1,"3d"))
              {
                  <td width="410" align="right" valign="middle">
                      <a href="/Home/Detail?id=@(model.ID)" title="@(model.title)" target="_blank"><img src="/Images/Upload/@(model.imagefilename)" style="border: 5px solid #0A0A0A;" width="380" height="260"></a>

  </td>
              }
            <td align="left" valign="middle"><table width="96%" border="0" align="center" cellpadding="1" cellspacing="1">

  <tbody>
      @for (int i = 0; i < recommend.Count; i++)
      {
         if (i % 2 == 0)
         {
             @:<tr>
         }
                  <td height="24" width="50%">·@Html.ActionLink("["+@ClassTable.GetClassByID(recommend[i].classid.ToString()).classname+"]", "List", "Home", new { type = "3d", cat = @ClassTable.GetClassByID(recommend[i].classid.ToString()).ID }, new { target="_blank" }) 
                      @Html.ActionLink(@recommend[i].title, "Detail", "Home", new { id = recommend[i].ID }, new { target="_blank"})
                      </td>
         if((i+1)%2==0||(i+1)>recommend.Count)
         {
             @:</tr>
         }
      }
      </tbody></table>

</td>
          </tr>
        </tbody></table>	

  </td>
      </tr>
  
      <tr>
        <td height="40" align="center" valign="middle">&nbsp;&nbsp;&nbsp;
          <div style="font-size: 18px;font-weight: bold;color: #FF3000;">本周热门</div></td>
      </tr>
      <tr>
        <td align="center" valign="middle">
            @foreach(ModelTable model in hot)
            {
                <table class="tpbt" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                        <tr>
                            <td height="134" align="center" valign="middle"><a href="/Home/Detail?id=@(model.ID)" title="@(model.title)" target="_blank"><img width="160px" height="120px" src="/Images/Upload/@(model.imagefilename)"/></a></td>
                        </tr>
                        <tr>
                            <td height="30" align="center" valign="middle"><a href="/Home/Detail?id=@(model.ID)" target="_blank">
                                @if(model.title.Length>12)
                                {
                                     @(model.title.Substring(0,12))@:...
                                }
                                else
                                {
                                    @(model.title)
                                }</a></td>
                        </tr>
                    </tbody>
                </table>
            }
</td>
      </tr>
      <tr>
        <td height="50" align="center" valign="middle">&nbsp;&nbsp;&nbsp;
          <div style="font-size: 18px;font-weight: bold;color: #FF3000;">贴图素材</div></td>
      </tr>
      <tr>
        <td align="center"><table width="800" border="0" cellspacing="0" cellpadding="0">
          <tbody><tr>
            <td height="140"><table width="800" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#0C0C0C">
              <tbody><tr>
                  @foreach (ModelTable model in Picrecommend)
                  {
                      <td width="160" height="110" align="center"><a href="/Home/Detail?id=@(model.ID)" target="_blank"><img src="/Images/Upload/@(model.imagefilename)" width="120" height="90" border="0"></a></td>
                  }
              </tr>
              <tr>
                  @foreach (ModelTable model in Picrecommend)
                  {
                      <td height="25" align="center"><a href="/Home/Detail?id=@(model.ID)" target="_blank">@(model.title)</a></td>
                  }
              </tr>
            </tbody></table></td>
          </tr>
          <tr>
            <td class="sucailm">
                @foreach (ClassTable ct in ClassTable.GetAllChildClass("pic"))
                {
                    @:&nbsp;&nbsp;
                    @Html.ActionLink(@ct.classname, "List", "Home", new { type = "pic", cat = @ct.ID }, new { target="_blank"})
                }
</td>
          </tr>
        </tbody></table><table width="730" border="0" cellspacing="0" cellpadding="0">
  <tbody><tr>
    <td height="30" align="center" valign="middle"></td>
  </tr>
</tbody></table>
</td>
      </tr>
    </tbody></table></td>
    </tr>
</tbody></table>
